package com.yuke.cloud.service.uac.service;

import com.github.pagehelper.PageInfo;
import com.yuke.cloud.common.base.dto.LoginAuthDto;
import com.yuke.cloud.service.uac.dto.PermissionMainQueryDto;
import com.yuke.cloud.service.uac.entity.AccMenu;
import com.yuke.cloud.service.uac.entity.AccPermission;
import com.yuke.cloud.common.core.support.IService;

import java.util.List;


/**
 * Created by wg on 2018/09/15.
 */
public interface AccPermissionService extends IService<AccPermission> {

    /**
     * 根据用户Id查询拥有的权限.
     *
     * @param userId the user id
     *
     * @return the own uac permission list
     */
    List<AccPermission> getOwnPermissionListByUserId(Long userId);

    /**
     * Matches by url acc permission.
     *
     * @param requestUrl the request url
     *
     * @return the acc action
     */
    AccPermission matchesByUrl(String requestUrl);

    /**
     * Delete by menu id int.
     *
     * @param id the id
     *
     * @return the int
     */
    int deleteByMenuId(Long id);

    PageInfo queryPermissionListWithPage(PermissionMainQueryDto permissionMainQueryDto);
    void savePermission(AccPermission accPermission, LoginAuthDto loginAuthDto);
    int deletePermissionById(Long permissionId);
    int batchDeleteByIdList(List<Long> deleteIdList);

    /**
     * 根据菜单ID List 查询权限列表.
     *
     * @param accMenus the uac menus
     *
     * @return the list
     */
    List<AccPermission> listPermissionListByMenus(List<AccMenu> accMenus);
}
